from random import randint
# 创建Die类
class Die:
    """模拟6面骰子"""
    def __init__(self):
        self.sides = 6

    def roll_die(self):
        """打印1到6之间的随机数"""
        return randint(1,self.sides)

# 创建实例
die = Die()
print(f"{die.sides}面骰子，抛十次结果：")
for i in range(10):
    print(f"第{i+1}次：{die.roll_die()}")

die.sides = 10
print(f"{die.sides}面骰子，抛十次结果：")
for i in range(10):
    print(f"第{i+1}次：{die.roll_die()}")

die.sides = 20
print(f"{die.sides}面骰子，抛十次结果：")
for i in range(10):
    print(f"第{i+1}次：{die.roll_die()}")



